<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<tiles:insert page="/general/templateLoggedIn.jsp">
	<tiles:put name="title" value="Applications by Reviewer"/>
	<tiles:put name="nav"/>
	<tiles:put name="content" type="string">

		<h2>Applications by Reviewer</h2>

		<table class="border">
			<tr><th>Reviewer</th><th>Graded</th><th>Ungraded</th></tr>
			<c:forEach var="reviewer" items="${requestScope.reviewers}">
				<tr class="evenHover">
					<td>${reviewer.mail}</td>
					<td>
						<c:choose>
							<c:when test="${reviewer.graded != 0}">
								<html:link action="/gradedApplications">
									<html:param name="mail" value="${reviewer.mail}" />
									${reviewer.graded}
								</html:link>
							</c:when>
							<c:otherwise>
								${reviewer.graded}
							</c:otherwise>
						</c:choose>
					<td>
						<c:choose>
							<c:when test="${reviewer.ungraded != 0}">
								<html:link action="/ungradedApplications">
									<html:param name="mail" value="${reviewer.mail}" />
									${reviewer.ungraded}
								</html:link>
							</c:when>
							<c:otherwise>
								${reviewer.ungraded}
							</c:otherwise>
						</c:choose>
					</td>
				</tr>
			</c:forEach>
		</table>		
		
	</tiles:put>
</tiles:insert>	